﻿namespace Sidvall.LogManager.Data.Keys
{
    public class LogScopeItemCategoryKey
    {
        public string Category { get; set; }
        public long LogScopeItemId { get; set; }
        
        public static LogScopeItemCategoryKey GetKey(ILogScopeItemCategory item)
        {
            if (item == null)
                return null;
            if (item.Category == null)
                return null;
            return new LogScopeItemCategoryKey()
            {
                Category = item.Category,
                LogScopeItemId = item.LogScopeItemId,
            };
        }
        public static LogScopeItemCategoryKey GetKey(string category, long logScopeItemId)
        {
            if (category == null)
                return null;
            return new LogScopeItemCategoryKey()
            {
                Category = category,
                LogScopeItemId = logScopeItemId,
            };
        }
    }
}